home *** CD-ROM | disk | FTP | other *** search
/ SGI Varsity Update 1998 August / SGI Varsity Update 1998 August.iso / dist / dist6.5 / il_dev.idb / usr / include / il / ilPolyWarpImg.h.z / ilPolyWarpImg.h
C/C++ Source or Header  |  1998-07-29  |  3KB  |  87 lines

  1. #if 0 
  2.  
  3.     Copyright (c) 1991 SGI   All Rights Reserved
  4.     THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI
  5.     The copyright notice above does not evidence any
  6.     actual or intended publication of such source code,
  7.     and is an unpublished work by Silicon Graphics, Inc.
  8.     This material contains CONFIDENTIAL INFORMATION that
  9.     is the property of Silicon Graphics, Inc. Any use,
  10.     duplication or disclosure not specifically authorized
  11.     by Silicon Graphics is strictly prohibited.
  12.     
  13.     RESTRICTED RIGHTS LEGEND:
  14.     
  15.     Use, duplication or disclosure by the Government is
  16.     subject to restrictions as set forth in subdivision
  17.     (c)(1)(ii) of the Rights in Technical Data and Computer
  18.     Software clause at DFARS 52.227-7013, and/or in similar
  19.     or successor clauses in the FAR, DOD or NASA FAR
  20.     Supplement.  Unpublished- rights reserved under the
  21.     Copyright Laws of the United States.  Contractor is
  22.     SILICON GRAPHICS, INC., 2011 N. Shoreline Blvd.,
  23.     Mountain View, CA 94039-7311
  24.  
  25. #endif
  26. /*
  27.     ilPolyWarp is derived from ilWarpImg.  It mainly exists for backwards
  28.     compatibility.  You can accomplish the same thing by passing an
  29.     ilPolyWarp to ilWarpImg directly.
  30. */
  31.  
  32. #ifndef _ilPolyWarpImg_h_
  33. #define _ilPolyWarpImg_h_
  34.  
  35. #include <il/ilWarpImg.h>
  36. #include <ifl/iflCoord.h>
  37. #include <il/ilPolyDef.h>
  38. #include <il/ilPolyWarp.h>
  39. #include <il/ilError.h>
  40. #include <assert.h>
  41.  
  42. class ilPolyWarpImg : public ilWarpImg {
  43. public:
  44.     iflClassListDeclare
  45.     ~ilPolyWarpImg()
  46.     { delete pwarp; }
  47.     // external api: begin
  48.     ilPolyWarpImg(ilImage* img = NULL, ilResampType rs=ilNearNb) : ilWarpImg(img, rs)
  49.     { pwarp = new ilPolyWarp(); ilWarpImg::setWarp((ilWarp*)pwarp); }
  50.  
  51.     ilStatus setWarp(const ilPolyWarp &Xyc)
  52.     {
  53.         pwarp->init(Xyc.getCoeffX(), Xyc.getCoeffY()); 
  54.     ilWarpImg::setWarp((ilWarp*)pwarp); 
  55.     return ilOKAY; 
  56.     }
  57.  
  58.     // external api: name=setWarpCoeff
  59.     ilStatus setWarp(const ilPoly2D& xc, const ilPoly2D& yc)
  60.     { pwarp->init(xc, yc); ilWarpImg::setWarp((ilWarp*)pwarp); return ilOKAY; }
  61.  
  62.     void getWarp(ilPolyWarp &Xyc) const
  63.         { Xyc.init(pwarp->getCoeffX(), pwarp->getCoeffY()); }
  64.  
  65.     // external api: name=getWarpCoeff
  66.     void getWarp(ilPoly2D& xc, ilPoly2D& yc) const
  67.     { xc = pwarp->getCoeffX(); yc = pwarp->getCoeffY(); }
  68.     int getWarpDegree() const
  69.     {
  70.     assert(pwarp->getCoeffX().degree == pwarp->getCoeffY().degree);
  71.     return pwarp->getCoeffX().degree;
  72.     }
  73.  
  74.     // external api: end
  75.  
  76.     #if defined(IL2_5_COMPAT)
  77.     ilStatus setCoeff(const ilPoly2D& xc, const ilPoly2D& yc)
  78.         { return setWarp(xc, yc); }
  79.     void getCoeff(ilPoly2D& xc, ilPoly2D& yc) const { getWarp(xc, yc); }
  80.     int getPolyOrder() const { return getWarpDegree(); }
  81.     #endif
  82.  
  83. private:
  84.     ilPolyWarp* pwarp;
  85. };
  86. #endif
  87.